package com.demo2do.fms.entity.vehicle;

import com.demo2do.core.utils.Alias;

/**
 * 车辆审核状态
 * 
 * @author Wy
 */
@Alias("VehicleAuditStatus")
public enum AuditStatus {
    
    EDITING("editing", "编辑中"),
    
    AUDITING("auditing", "待审核"),
    
    REJECTED("rejected", "驳回"),
    
    QUALIFIED("qualified", "合格"),
    
    MODIFIED("modified", "变更申报");

    private String alias;
    
    private String description;

    /**
     * @param alias
     * @param description
     */
    private AuditStatus(String alias , String description) {
        this.alias = alias;
        this.description = description;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static AuditStatus aliasOf(String alias){
        
        for(AuditStatus auditStatus : AuditStatus.values()){
            if(auditStatus.getAlias().equals(alias)){
                
                return auditStatus;
            }
        }
        return null;
    }
    
    /**
     * @return
     */
    public boolean isEditing() {
        return this.equals(EDITING);
    }
    
    /**
     * @return
     */
    public boolean isAuditing() {
        return this.equals(AUDITING);
    }
    
    /**
     * @return
     */
    public boolean isRejected() {
        return this.equals(REJECTED);
    }
    
    /**
     * @return
     */
    public boolean isQualified() {
        return this.equals(QUALIFIED);
    }
    
    /**
     * 
     * @return
     */
    public boolean isModified() {
        return this.equals(MODIFIED);
    }
    
    /**
     * @return  alias
     */
    public String getAlias() {
        return alias;
    }
    
    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

}
